package com.example.demo.service;

import com.example.demo.bean.ClassesBean;
import com.example.demo.bean.GroupBean;
import com.example.demo.repository.ClassesRepository;
import com.example.demo.repository.GroupRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;

@Transactional
@Service
public class ClassesService {

    @Autowired
    ClassesRepository classesRepository;

    public ClassesBean addClass(ClassesBean classesBean){
        return classesRepository.save(classesBean);
    }

    public List<Map<String, Object>> findClassBean(){
        List<Map<String, Object>> list = classesRepository.findClass();
        return list;
    }


}
